import request from "@/utils/request";

// 获取角色列表
export function getRoleList(params) {
  return request({
    url: "/api/system/ae/roles",
    method: "get",
    params,
  });
}

// 获取角色详情
export function getRoleById(id) {
  return request({
    url: `/api/system/ae/roles/${id}`,
    method: "get",
  });
}

// 创建角色
export function createRole(data) {
  return request({
    url: "/api/system/ae/roles",
    method: "post",
    data,
  });
}

// 更新角色
export function updateRole(id, data) {
  return request({
    url: `/api/system/ae/roles/${id}`,
    method: "put",
    data,
  });
}

// 删除角色
export function deleteRole(id) {
  return request({
    url: `/api/system/ae/roles/${id}`,
    method: "delete",
  });
}

// 启用角色
export function enableRole(id) {
  return request({
    url: `/api/system/ae/roles/${id}/enable`,
    method: "post",
  });
}

// 禁用角色
export function disableRole(id) {
  return request({
    url: `/api/system/ae/roles/${id}/disable`,
    method: "post",
  });
}
